// vue.config.js
const path = require('path');
const resolve = (dir) => path.join(__dirname, dir);

module.exports = {
  publicPath: './', // 基本路径
  outputDir: 'dist', // 输出文件目录
  // 修改less-loader，考虑后面可能修改主题颜色
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          modifyVars: {
            'primary-color': '#1DA57A',
            'link-color': '#1DA57A',
            'border-radius-base': '2px',
          },
          javascriptEnabled: true
        },
      },
    },
  },
  devServer: {
    proxy: {
      '/apis': {
        // target: ' http://192.168.6.11:9004',
        target:'http://192.168.4.119:9010/ubom',
        //target:'http://192.168.4.119:9004',
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          '^/apis': ''
        }
      },
      '/messageApi': {
        target: 'http://192.168.4.119:9010/message',
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          '^/messageApi': ''
        }
      }
    }
  },
  lintOnSave: true,
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@$', resolve('src'))
      .set('assets', resolve('src/assets'))
      .set('utils', resolve('src/utils'))
      .set('api', resolve('src/api'))
      .set('components', resolve('src/components'))
      .set('stylus', resolve('src/assets/stylus'));
  },
  configureWebpack: {
    //关闭 webpack 的性能提示
    performance: {
      hints:false
    }
  }
};
